package com.huffman.smart_picture.domain.enums;

import lombok.Getter;

/**
 * @author DengLin
 * @title 平台枚举
 * @date 2025/4/9
 */
@Getter
public enum PlatformEnum {

    USER_PLATFORM(1, "用户端"),

    ADMIN_PLATFORM(2, "管理端");
    private Integer platformCode;

    private String desc;

    PlatformEnum(Integer platformCode, String desc) {
        this.platformCode = platformCode;
        this.desc = desc;
    }

    public static PlatformEnum getUserPlatformEnumByCode(Integer platformCode) {
        for (PlatformEnum platformEnum : PlatformEnum.values()) {
            if (platformEnum.platformCode.equals(platformCode)){
                return platformEnum;
            }
        }
        return null;
    }
}
